import request from '@/utils/request'

export const getUserInfoList = (page, limit, username) => {
  return request.get(`/admin/acl/user/${page}/${limit}?username=${username}`)
}

// 新增用户
export const saveUserApi = (data) => {
  return request.post(`/admin/acl/user/save`, data)
}
// 修改用户
export const updateUserApi = (data) => {
  return request.put(`/admin/acl/user/update`, data)
}
// 获取用户角色
export const getUserRolesApi = (adminId) => {
  return request.get(`/admin/acl/user/toAssign/${adminId}`)
}

// 给用户分配角色
export const assignRolesApi = (adminId, roleId) => {
  return request.post(`/admin/acl/user/doAssign?userId=${adminId}&roleId=${roleId}`)
}
// 删除用户
export const delUserApi = (id) => {
  return request.delete(`/admin/acl/user/remove/${id}`)
}
